<template>
    <div class='content'>
        <div class="profile_page">
            <head-top :go-back='goBack' :head-title="profiletitle"></head-top>
        </div>
        <div class="formContain">
            <titlebar :title-left='titleLeft'></titlebar>
            <ul>
                <li class="flex">
                    <span class="label">员工工号</span>
                    <div>
                        <span class="vtext">{{datas.personCode}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">姓名</span>
                    <div>
                        <span class="vtext">{{datas.id}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">单位</span>
                    <div>
                        <span class="vtext">{{datas.orgName}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">部门</span>
                    <div>
                        <span class="vtext">{{datas.deptName}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">职级</span>
                    <div>
                        <span class="vtext">{{datas.postRank}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">岗位</span>
                    <div>
                        <span class="vtext">{{datas.postName}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">入职日期</span>
                    <div>
                        <input type="text"  :value="datas.inOrgTime"  readonly>
                        <img src="@/assets/images/img/calendarIcon.png" alt="">
                    </div>
                </li>
                <li class="flex">
                    <span class="label">转正日期</span>
                    <div>
                        <input type="text"  :value="datas.turnPositiveTime"  readonly>
                        <img src="@/assets/images/img/calendarIcon.png" alt="">
                    </div>
                </li>
            </ul>

        </div>
        <div class="formContain" :class="{disableForm:disableFormShow}">
            <titlebar :title-left='titleLeft1'></titlebar>
            <ul>
                <li class="flex">
                    <span class="label" style="text-align: center;font-size: 0.7rem;font-weight: 600;width: 100%">考勤状况</span>
                </li>
                <li class="flex">
                    <span class="label">出勤</span>
                    <div>
                        <van-field v-model="datas.chuqin" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">事/病假</span>
                    <div>
                        <van-field v-model="datas.qingjia" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">迟到/早退</span>
                    <div>
                        <van-field v-model="datas.chidao" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">奖励</span>
                    <div>
                        <van-field v-model="datas.jiangli" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">处罚</span>
                    <div>
                        <van-field v-model="datas.chufa" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">其他</span>
                    <div>
                        <van-field v-model="datas.qita" placeholder="请输入" type="text" input-align="right"/>
                    </div>
                </li>
            </ul>
        </div>
        <div class="formContain" :class="{disableForm:disableFormShow}">
            <ul>
                <li class="flex">
                    <span class="label" style="text-align: center;font-size: 0.7rem;font-weight: 600;width: 100%">个人情况(30分)</span>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">纪律性：能否遵守公司规章制度，服从领导分配。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q1" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q1','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q1c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">专业知识：是否具有丰富的理论知识和实践经验，并在工作中运用实施。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q2" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q2','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q2c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">个性操守：能否保守公司秘密，职业道德素质评价。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q3" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q3','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q3c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
            </ul>
        </div>
        <div class="formContain" :class="{disableForm:disableFormShow}">
            <ul>
                <li class="flex">
                    <span class="label" style="text-align: center;font-size: 0.7rem;font-weight: 600;width: 100%">工作能力(40分)</span>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">工作内容：试用期内负责的主要工作内容，能否完成公司确定的工作目标。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q4" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q4','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q4c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">工作质量：完成数量、质量，错误率。（20分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q5" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q5','20')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q5c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">工作效率：能否及时完成工作计划，独立工作能力。（10分）（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q6" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q6','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q6c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
            </ul>
        </div>
        <div class="formContain" :class="{disableForm:disableFormShow}">
            <ul>
                <li class="flex">
                    <span class="label" style="text-align: center;font-size: 0.7rem;font-weight: 600;width: 100%">能力态度(30分)</span>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">组织能力，协调沟通，人际关系处理能力。(10分)</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q7" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q7','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q7c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">工作态度：能否积极主动完成工作，是否具有责任感和服务意识。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q8" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q8','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q8c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label" style="line-height: 1rem;margin: 0.2rem 0">学习与创新：能否积极寻找解决问题的最佳方法，学习能力，发展潜力。（10分）</span>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>得分</span>
                    <div>
                        <van-field v-model="datas.q9" placeholder="请输入" type="number" input-align="right"  @input="compositeScore('q9','10')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>考核评价</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.q9c" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label">综合得分</span>
                    <div>
                        <span class="vtext">{{datas.total}}</span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow">*</i>工作需改进之处</span>
                    <div>
                        <van-field class='full_width' autosize v-model="datas.improve" rows="1" type="textarea" input-align="right"/>
                    </div>
                </li>
            </ul>
        </div>
        <div class="formContain" :class="{disableForm:disableFormShow1}">
            <titlebar :title-left='titleLeft3'></titlebar>
            <ul>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>转正类型</span>
                    <div @click="showpicker($event,'conclusion','转正类型','conclusion')" v-if="!disableFormShow1">
                        <input type="text"  id="type" placeholder="请选择转正类型" :value="datas.conclusion|dictNum('conclusion')"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                    <div v-if="disableFormShow1">
                        <input type="text"   placeholder="请选择转正类型" :value="datas.conclusion"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>面试评定得分</span>
                    <div>
                        <van-field v-model="datas.interview" placeholder="请输入" type="number" input-align="right"  @input="finalCal('interview')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>转正评定得分</span>
                    <div>
                        <van-field v-model="datas.turnPositiveScore" placeholder="请输入" type="number" input-align="right" @input="finalCal('turnPositiveScore')"/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>最终得分（面试30%+转正70%）</span>
                    <div>
                        <van-field v-model="finalScore" placeholder="请输入" type="text" style="color: #000" input-align="right" disabled/>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>拟定工资薪级</span>
                    <div @click="showpicker($event,'salaryLevel','工资薪级','3173')" v-if="!disableFormShow1">
                        <input type="text" placeholder="请选择工资薪级" :value="datas.salaryLevel|dictNum('3173')"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                    <div v-if="disableFormShow1">
                        <input type="text"   placeholder="请选择工资薪级" :value="datas.salaryLevel"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>拟定工资薪档</span>
                    <div @click="showpicker($event,'salary','工资薪档','3649')" v-if="!disableFormShow1">
                        <input type="text" placeholder="请选择工资薪档" :value="datas.salary|dictNum('3649')"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                    <div v-if="disableFormShow1">
                        <input type="text"   placeholder="请选择工资薪档" :value="datas.salary"  readonly>
                        <span class="iconfont icon-xiala"></span>
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require" v-if="!disableFormShow1">*</i>转正日期</span>
                    <div @click="showdatepicker($event,'turnPositiveDate')">
                        <input type="text"  placeholder="请选择时间" :value="datas.turnPositiveDate"  readonly>
                        <img src="@/assets/images/img/calendarIcon.png" alt="" srcset="" >
                    </div>
                </li>
            </ul>
        </div>
        <div class="formContain">
            <titlebar :title-left='titleLeft2'></titlebar>
            <ul v-if="attachments.length>0">
                <li class="flex" v-for="(item,index) in attachments" :key="item.attachmentId">
                    <span class="label">附件{{index+1}}</span>
                    <div @click="downloadFile(item.attachmentId,item.attachmentName)">
                        <span class="vtext" >{{item.attachmentName}}</span>
                        <img src="@/assets/image/ico_down.png" alt="">
                    </div>
                </li>
                <li class="flex">
                    <span class="label"><i class="require">*</i>审批意见</span>
                    <div style="min-height:3rem">
                        <van-field class='full_width' autosize v-model="opinion" type="textarea" input-align="right"/>
                    </div>
                </li>
            </ul>
            <ul v-if="attachments.length<=0">
                <li class="label" style="text-align: center;line-height: 1rem;font-size: 0.54rem">暂无附件</li>
                <li class="flex">
                    <span class="label"><i class="require">*</i>审批意见</span>
                    <div style="min-height:3rem">
                        <van-field class='full_width' autosize v-model="opinion" type="textarea" input-align="right"/>
                    </div>
                </li>
            </ul>
        </div>
        <div class="align_center foot-button">
            <van-button class="cancel-btn" type="primary" @click="saveData('no')">退回</van-button>
            <van-button class="primary-btn" type="primary" @click="saveData('yes')">同意</van-button>
        </div>
        <van-popup v-model="pickershow" position="bottom">
            <van-picker  show-toolbar  value-key="text" :title="title" :columns="columns" @cancel="onCancel" @confirm="onConfirm"/>
        </van-popup>
        <van-popup v-model="show" position="bottom">
            <van-datetime-picker type="date" @confirm="datetimeSelect" @cancel='cancel' v-model="currentTime"/>
        </van-popup>
        <van-image-preview v-model="previewShow" :images="images"></van-image-preview>
    </div>
</template>

<script>
    var that;
    let Base64 = require('js-base64').Base64
    import headTop from '@/components/header/head'
    import titlebar from '@/components/titlebar3/titlebar3';
    import {getPersonRegularData,submitApply,getAttachment,getRegularNode,saveRegularData} from '@/service/getData';
    import {setStore,getStore,getDefault,contextRoot} from '@/assets/config/mUtils';
    import {Dialog, Toast} from 'vant';
    import {getUser} from '@/service/getData';

    export default {
        data() {
            return {
                company: "",//所属公司
                profiletitle: '待办事项',
                goBack: true,
                titleLeft: '基本信息',
                titleLeft1: '考评内容(由直属领导填写)',
                titleLeft2: '附件信息',
                titleLeft3: '评价结论(由人事填写)',
                show: false, //控制日期显示隐藏
                disableFormShow: false,
                disableFormShow1: false,
                pickershow: false,//控制下拉选显示隐藏
                pickerName: '',//当前控制日期的控件
                currentTime: new Date(),
                title:'标题',//下拉框标题
                fileName: '',
                datas: {
                    personCode:'',
                    id:'',
                    orgName:'',
                    deptName:'',
                    postRank:'',
                    postName:'',
                    inOrgTime:'',
                    turnPositiveTime:'',
                    chuqin:'',
                    qingjia:'',
                    chidao:'',
                    jiangli:'',
                    chufa:'',
                    qita:'',
                    q1:'',
                    q1c:'',
                    q2:'',
                    q2c:'',
                    q3:'',
                    q3c:'',
                    q4:'',
                    q4c:'',
                    q5:'',
                    q5c:'',
                    q6:'',
                    q6c:'',
                    q7:'',
                    q7c:'',
                    q8:'',
                    q8c:'',
                    q9:'',
                    q9c:'',
                    total:'',
                    improve:'',
                    conclusion:'',
                    interview:'',
                    turnPositiveScore:'',
                    salary:'',
                    salaryLevel:'',
                    turnPositiveDate:'',
                },
                partyFigureText: '',
                lookUrl: '',
                useType: 'apply',
                screenHeight: '',
                applyType: '',
                columns:[],
                codeSet:{},
                taskId:'',
                startManagerId:'',
                procInstId:'',
                opinion:'',
                attachments:[],
                finalScore:'',
                previewShow:false,
                images:[]
            }
        },
        created() {
            that = this;
            this.startManagerId = this.$route.query.startManagerId;
            this.taskId = this.$route.query.taskId;
            this.procInstId = this.$route.query.procInstId;
            this.codeSet = this.$store.state.codeSet;

            var data = {};
            data.app_userId = getStore('user_id');
            data.id = this.startManagerId;
            data.CHECK_TIME = new Date().getTime().toString();
            data.CHECK_SIGN = this.$md5(data.app_userId + data.CHECK_TIME + "3a28fba00c015e0df7f88556c91cb7fc");
            getPersonRegularData(data).then(res => {
                this.datas = res.data;
                this.finalScore = (Number(this.datas.interview*0.3) + Number(this.datas.turnPositiveScore*0.7)).toFixed(2);
            });
            getAttachment(data).then(res=>{
                console.log(res);
                this.attachments = res.data.data;
            });
            var data1 = {};
            data1.app_userId = getStore('user_id');
            data1.taskId  = this.taskId ;
            data1.procInstanceId   = this.procInstId;
            data1.CHECK_TIME = new Date().getTime().toString();
            data1.CHECK_SIGN = this.$md5(data1.app_userId + data1.CHECK_TIME + "3a28fba00c015e0df7f88556c91cb7fc");
            getRegularNode(data1).then(res=>{{
                if(res.data.isFirstApproveTaskKey == '00901'){
                    this.disableFormShow = false;
                }else {
                    this.disableFormShow = true;
                };
                if(res.data.isHeadOfManpowerTaskKey == '00901'){
                    this.disableFormShow1 = false;
                }else {
                    this.disableFormShow1 = true;
                }
            }})
        },
        mounted() {
            const _self = this;
            this.screenHeight = document.documentElement.clientHeight;
        },
        components: {
            headTop,
            titlebar,
        },
        updated() {
            let that = this;
        },
        filters:{
            dictNum:function(val,arg1){
                if(val!=""&&val!=undefined&&val!=null){
                    if(arg1 == 'conclusion'){
                        var tempArr = [{'id':'3701000001','text':'试用期不合格'},{'id':'3701000002','text':'按期转正'},{'id':'3701000003','text':'提前转正'}];
                        var arr = tempArr.filter(item=>item.id === val);
                        if(arr){
                            return arr[0].text;
                        }else {
                            return "";
                        }
                    }else{
                        var arr = that.codeSet[arg1].filter(item => item.id === val);
//          console.log(val,arr);
                        return arr[0].text;
                    }


                }

            }
        },
        methods: {
            //计算最终得分
            finalCal(type){
                if(this.datas[type]>100){
                    this.datas[type] = 100;
                }
               if(this.datas.interview&&this.datas.turnPositiveScore) {
                   this.finalScore = (Number(this.datas.interview*0.3) + Number(this.datas.turnPositiveScore*0.7)).toFixed(2);
               }
            },
            //计算综合得分
            compositeScore(type,score){
                console.log(this.datas[type]);
                if(this.datas[type]> Number(score)){
                    this.datas[type] = Number(score);
                }
              var total = Number(this.datas.q1)+ Number(this.datas.q2)+ Number(this.datas.q3)+ Number(this.datas.q4)+ Number(this.datas.q5)+ Number(this.datas.q6)+ Number(this.datas.q7)+ Number(this.datas.q8)+ Number(this.datas.q9);
              this.datas.total = total;
            },
            downloadFile(fileId,attachmentName) {
                var fileTypeArr = attachmentName.split(".");
                var fileType = fileTypeArr[fileTypeArr.length - 1].toLocaleLowerCase();
                if(fileType == 'pdf'){
                    this.$router.push(
                      { name: 'excelView', query: {fileId:fileId}}
                    );
                }else if(fileType == 'jpg'||fileType == 'png'||fileType == 'jpeg'||fileType == 'gif'||fileType == 'bmp'){
                    this.images = [];
                    this.previewShow = true;
                    let baseUrl = contextRoot();
                    var previewSrc = baseUrl+ '/api/file/att/download?fileId='+fileId.base64Encode()+'&app_userId='+getStore('user_id');
                    this.images.push(previewSrc);
                }else {
                    Dialog.alert({
                        title: '提示',
                        message: '附件类型不支持在线预览!',
                    }).then(() => {
                        // on close
                    });
                }
            },
            addZero(num){
                var addNum = num<10?"0"+num:num;
                return addNum;
            },
            datetimeSelect(value){
                this.show = false;
                var date = value;
                var val = date.getFullYear() + '-'+this.addZero(date.getMonth()+1) + '-'+ this.addZero(date.getDate());
                this.$set(this.datas,this.pickerName,val);
            },
            showpicker(event,name,title,code){
                if(code == 'conclusion'){
                    this.columns  = [{'id':'3701000001','text':'试用期不合格'},{'id':'3701000002','text':'按期转正'},{'id':'3701000003','text':'提前转正'}];
                }else {
                    this.columns = this.codeSet[code];
                }

                this.pickershow = true;
                this.pickerName = name;
                this.title = title;
            },
            cancel() {
                this.show = false;
            },
            onConfirm(value){
                this.$set(this.datas,this.pickerName,value.id);
                this.pickershow = false;
                console.log(this.datas);
            },
            onCancel(){
                this.pickershow = false;
            },

            showdatepicker(event,name){
                this.show = true;
                this.pickerName = name;
            },
            saveData(msg) {
                if(!this.disableFormShow){
                    if(this.datas.q1c == ''||this.datas.q2c == ''||this.datas.q3c == ''||this.datas.q4c == ''||this.datas.q5c == ''||this.datas.q6c == ''||this.datas.q7c == ''||this.datas.q8c == ''||this.datas.q9c == ''||this.datas.jiangli == ''||this.datas.chidao == ''||this.datas.qita == ''||this.datas.chufa == ''||this.datas.qingjia == ''||this.datas.chuqin == ''||this.datas.improve == ''){
                        Toast({
                            message:'必填项不能为空!',
                            duration:'1000',
                        });
                        return;
                    }
                };
                if(!this.disableFormShow1){
                    if(this.datas.salary == ''||this.datas.salaryLevel == ''||this.datas.interview == ''||this.datas.turnPositiveScore == ''||this.datas.turnPositiveDate == ''){
                        Toast({
                            message:'必填项不能为空!',
                            duration:'1000',
                        });
                        return;
                    }
                }
                if(this.opinion ==''){
                    Toast({
                        message:'必填项不能为空!',
                        duration:'1000',
                    });
                    return;
                }
                Toast.loading({
                    duration: 0,   // 持续展示 toast
                    overlay: true,
                    message: '正在提交...'
                });

                var data = {};
                data.app_userId = getStore('user_id');
                data.CHECK_TIME = new Date().getTime().toString();
                data.CHECK_SIGN = this.$md5(data.app_userId + data.CHECK_TIME + "3a28fba00c015e0df7f88556c91cb7fc");
                data.taskId = this.taskId;
                data.procInstanceId = Base64.encode(this.procInstId);
                data.msg = msg;
                data.opinion = this.opinion;
                console.log(data);
                if(!this.disableFormShow||!this.disableFormShow1){
                    var saveData = this.datas;
                    saveData.id = this.datas.personId;
                    saveData.app_userId = getStore('user_id');
                    saveData.CHECK_TIME = new Date().getTime().toString();
                    saveData.CHECK_SIGN = this.$md5(saveData.app_userId + saveData.CHECK_TIME + "3a28fba00c015e0df7f88556c91cb7fc");
                    console.log(saveData);
                    saveRegularData(saveData).then(res=>{
                        if(res.data.result == "ok"){
                            submitApply(data).then(res1 => {
                                Toast.clear();
                                Dialog.alert({
                                    title: '提示',
                                    message: '审批成功！',
                                }).then(() => {
                                    this.$router.go(-1);
                                });
                            })
                        }
                    })
                }else {
                    submitApply(data).then(res => {
                        Toast.clear();
                        Dialog.alert({
                            title: '提示',
                            message: '审批成功！',
                        }).then(() => {
                            this.$router.go(-1);
                        });
                    })
                }

            },

        }
    }

</script>

<style lang="scss" scoped>
    @import '../../../assets/style/mixin';
    @import '../../../assets/style/public';

    .formContain {
        background: #fff;
        ul {
            padding: 0 .54rem;
            .flex {
                justify-content: space-between;
                align-items: center;
                line-height: 2rem;
                border-bottom: 1px solid #e0e0e0;
                padding: 0 .3rem;
                &:nth-last-of-type(1) {
                    border: none;
                }
                .label {
                    font-size: .56rem;
                    line-height: 2rem;
                    color: #333333;
                }
                div {
                    display: flex;
                    justify-content: flex-end;
                    align-items: center;
                    position: relative;
                    flex-grow: 1;
                    img {
                        width: .68rem;
                        height: .64rem;
                    }
                    input {
                        color: #323233;
                        text-align: right;
                        font-size: .48rem;
                        padding-right: .48rem;
                        border: none;
                        &:-ms-input-placeholder {
                            color: #aaa;
                            font-size: .48rem;

                        }
                    }
                    .file {
                        width: 2rem;
                        height: 1rem;
                        font-size: 10rem;
                        opacity: 0;
                        position: absolute;
                        right: 0;
                    }
                    .van-cell {
                        font-size: .48rem;
                        padding-right: .48rem;
                        padding: 0;
                        color: #aaa;
                        .van-field__control {
                            color: #aaa;
                        }
                    }

                }
            }
        }
    }

    .foot-button {
        margin-top: 2rem;
        margin-bottom: .4rem;
        .cancel-btn {
            margin-right: 1rem;
        }
    }

    #datetime-picker, #picker {
        position: fixed;
        width: 100%;
        bottom: 0;
    }

    .require {
        color: red;
        margin-right: 4px;
        font-style: inherit;
        font-size: 14px;
    }
    .vtext{
        font-size: 0.48rem;
        text-align: right;
        line-height: 1rem;
    }
    .custom-button {
        width: 30px;
        color: #fff;
        font-size: 10px;
        line-height: 18px;
        text-align: center;
        background-color: #ee0a24;
        border-radius: 100px;
    }
    .disableForm{
        position: relative;
    }
    .disableForm:after {
        position: absolute;
        width: 100%;
        height: 100%;
        background: transparent;
        left: 0;
        top: 0;
        content: '';
        z-index: 99;
    }
</style>
